package HomeWork4;

public class Warrior implements  Fightable{
    private int experience;

    public int getExperience() {
        return experience;
    }

    public void setExperience(int experience) {
        this.experience = experience;
    }

    public int getBlood() {
        return blood;
    }

    public void setBlood(int blood) {
        this.blood = blood;
    }

    private int blood;

    public Warrior() {
    }

    public Warrior(int experience, int blood) {
        this.experience = experience;
        this.blood = blood;
    }

    @Override
    public void win() {
        this.experience +=10;
        System.out.println("经验值加10，总经验："+this.experience);

    }

    @Override
    public int injurre(int X) {
        int blood = this.getBlood() - X;
        if (blood<MAX){
            System.out.println("没血了");
        }

        return blood;
    }
}
